<template>
  <div class="goodsdesc-container">
    <h3>{{ goodsInfo.title }}</h3>

    <hr>

    <div class="content" v-html="goodsInfo.content"></div>
  </div>
</template>

<script>
// import Toast from 'mint-ui'

export default {
    data(){  // 将路由对象的parmas属性挂载到 data 中， 方便后期调用
        return{
            id: this.$route.params.id,
            // goodsInfo: [] // 图文数据   真数据则是数组
            goodsInfo: {
                title: '荣耀10青春版 幻彩渐变 2400万AI自拍',
                content: '<img src="https://img30.360buyimg.com/sku/jfs/t30223/342/597986041/292056/ccd6af99/5bf7c5afNb6aebc19.jpg"><img src="https://img30.360buyimg.com/sku/jfs/t29797/251/611922353/405086/460f4550/5bf7c40bNb3f9a524.jpg">'
            }
        }
    },
    created(){
        this.getDesc();
    },
    methods: {
        getDesc(){
            // this.$http.get('api/goods/getdesc/'+this.id).then(result => {
            //     if(result.body.status === 0){
            //         this.goodsInfo = result.body.message[0]
            //     }else {
            //         Toast("╮(╯▽╰)╭获取商品详情数据失败！！！")
            //     }
            // })

            this.goodsInfo;
        }
    }

}
</script>

<style lang="scss">
.goodsdesc-container {
  padding: 4px;
  h3 {
    font-size: 16px;
    color: #226aff;
    text-align: center;
    margin: 15px 0;
  }
  .content{
    img{
      width: 100%;
    }
  }
}
</style>
